package com.sk.sourcecircle.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sk.sourcecircle.R;
import com.sk.sourcecircle.entity.MyFriendBean;

import java.util.List;

/**
 * Created by sk on 2018/1/18.
 */

public class ShareFriendAdapter extends BaseQuickAdapter<MyFriendBean.DataBeanX.DataBean, BaseViewHolder> {

    public ShareFriendAdapter(int layoutResId, @Nullable List<MyFriendBean.DataBeanX.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MyFriendBean.DataBeanX.DataBean item) {
        if (item.getUser_friend_info() != null) {
            Glide.with(mContext).load(item.getUser_friend_info().getHead_url()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into((ImageView) helper.getView(R.id.head));
            helper.setText(R.id.tv_name, item.getUser_friend_info().getNickname());
        }
    }
}
